import { LOCATION_UPDATE } from './../constants/location'
import Taro from '@tarojs/taro'

export const locationUpdate = () => async dispatch => {
  Taro.getLocation({
    type: 'wgs84',
    success: (res => {
      dispatch({
        type: LOCATION_UPDATE,
        wxLocation: res
      })
    })
  })
}